package com.afalon.cloud.contracts.directory;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable
@XmlRootElement(name = "person")
@XmlAccessorType(XmlAccessType.NONE)
public class Person 
{
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key personKey;
	
	@XmlElement(name="lastname")
	@Persistent
	private String lastName;
	
	@XmlElement(name="firstname")
	@Persistent
	private String firstName;

	@XmlElement(name="middlenames")
	@Persistent
	private String middleNames;

	@XmlElement(name="dateofbirth")
	@Persistent
	private String dateOfBirth;

	@XmlElement
	@Persistent
	private String gender;

	@XmlElement
	@Persistent
	private String title;

	@XmlElement
	@Persistent
	private Boolean deceased;

	@XmlElement(name="dateofdeath")
	@Persistent
	private String dateOfDeath;
	
	public Person()
	{
		
	}
	
	public Key getPersonKey()
	{
		return personKey;
	}
	
	@XmlElement(name="personid")
	public String getPersonId() {
		return KeyFactory.keyToString(this.getPersonKey());
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setMiddleNames(String middleNames) {
		this.middleNames = middleNames;
	}

	public String getMiddleNames() {
		return middleNames;
	}

	public void setDateOfBirth(String dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public String getDateOfBirth() {
		return dateOfBirth;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getGender() {
		return gender;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitle() {
		return title;
	}

	public void setDeceased(Boolean deceased) {
		this.deceased = deceased;
	}

	public Boolean getDeceased() {
		return deceased;
	}

	public void setDateOfDeath(String dateOfDeath) {
		this.dateOfDeath = dateOfDeath;
	}

	public String getDateOfDeath() {
		return dateOfDeath;
	}
	

}
